package models

import (
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

var DB *gorm.DB
var err error

func MysqlLink() {
	DB, err = gorm.Open(mysql.Open("root:89B158B4DAFE6F5461878D26EA49B100@tcp(14.103.158.217:3306)/5.27work?charset=utf8&parseTime=True&loc=Local"))
	if err != nil {
		panic(err)
	}
	if err = DB.AutoMigrate(&User{}, &Job{}); err != nil {
		panic(err)
	}
}
